var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
};
function func() {
    var a = "chengzhu";
    // b是一个求和函数
    var b = function (x, y) { return x + y; };
    return [a, b];
}
var _a = func(), n = _a[0], m = _a[1];
// 下行报错，因为n和m类型是any
// console.log(m(1, 2));
// 正确，断言了m是函数，等于我告诉他m是函数
console.log(m(1, 2));
// 第2种解构断言方式
var _b = func(), a = _b[0], b = _b[1];
console.log(b(2, 3));
// 在返回的时候就断言
function func1() {
    var a = "zhangyun";
    // b是一个求和函数
    var b = function (x, y) { return x + y; };
    // 下面三行效果一样
    //   return [a, b] as [string, Function];
    //   return [a, b] as [typeof a, typeof b];
    return [a, b];
}
var _c = __spreadArray([], func1(), true), c = _c[0], d = _c[1];
console.log(d(3, 99));
